﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AccionDeMarketingEdit.aspx.cs"
    Inherits="CrmContacto.WebApp.App.AccionDeMarketingEdit" %>

<%@ Import Namespace="Web.Framework.Translate" %>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="/Scripts/App/AccionDeMarketingEdit.js" type="text/javascript"></script>
    <link href="/Styles/App/AccionDeMarketing.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <asp:Literal ID="lit1" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionDeMarketing.TituloGenerico"]%>' />
        <asp:Label ID="lblEspecificacionDeMarketing" runat="server" Text="Label"></asp:Label>
        <img width="15px" height="15px" id="imgExpand" class="imgExpand" src="/Images/icon_blockexpanded.png"
            onclick="window.AppCommonObj.toggleVisibility(this.id, 'accionDeMarketingEditDiv');"
            alt="" />
        <span class="clear"></span>
    </h2>
    <div class="editionContainerFilter" id="accionDeMarketingEditDiv">
        <p>
            <span class="title2">
                <asp:Literal ID="Literal1" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionDeMarketing.PlanDeMarketing"]%>' />:</span>
            <asp:TextBox ID="txtNombrePlanDeMarketing" runat="server" CssClass="inputs readonly"
                ClientIDMode="Static"></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title2">
                <asp:Literal ID="Literal10" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Nombre"]%>' />:</span>
            <asp:TextBox ID="txtNombre" runat="server" CssClass="inputs" ClientIDMode="Static"
                title='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Nombre"] %>'></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title2">
                <asp:Literal ID="Literal4" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Descripcion"]%>' />:</span>
            <asp:TextBox ID="txtDescripcion" TextMode="MultiLine" runat="server" CssClass="inputs inputMultiline"
                ClientIDMode="Static" title='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Descripcion"] %>'></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <p>
            <span class="title2">
                <asp:Literal ID="Literal5" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Codigo"]%>' />:</span>
            <asp:TextBox ID="txtCodigo" runat="server" CssClass="inputs" ClientIDMode="Static"
                title='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Codigo"] %>'></asp:TextBox>
        </p>
        <div class="clear">
        </div>
        <div class="divp">
            <span class="title2">
                <asp:Literal ID="litFechaEventoDesde" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.FechaEventoDesde"]%>' />:</span>
            <asp:TextBox ID="txtFechaDesde" runat="server" CssClass="inputs" ClientIDMode="Static"
                ></asp:TextBox>
        </div>
        <div class="divp" runat="server" id="divFechaEventoHasta">
            <span class="title2 secondColumn">
                <asp:Literal ID="Literal7" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.FechaEventoHasta"]%>' />:</span>
            <asp:TextBox ID="txtFechaHasta" runat="server" CssClass="inputs" ClientIDMode="Static"
                ></asp:TextBox>
                 <div class="clear">
        </div>
        </div>                  
        <div class="clear">
        </div>
    </div>
        
    <asp:Panel ID="pnlTabs" runat="server">        
    <h2>
        <asp:Image Width="15px" Height="15px" ID="Image1" CssClass="imgExpand" ImageUrl="/Images/icon_blockcollapsed.png"
            runat="server" ClientIDMode="Static" alt="" />
        <asp:Literal ID="Literal3" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.CampaniaInstancia.TituloResultados"]%>' />
        <asp:Label ID="Label1" runat="server" Text="" CssClass="lblSearchResult"></asp:Label>
    </h2>
    <div id="tabs" class="customerTabs">
          
        <asp:Literal ID="litTabs" runat="server"></asp:Literal>
        <%--<ul>
            <li ><a href="#pnlListasDeDistribucion">
                <asp:Literal ID="Literal2" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionDeMarketing.Tab.Listas"]%>' /></a></li>
            <li ><a href="#pnlResults">
                <asp:Literal ID="Literal8" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionDeMarketing.Tab.Resultados"]%>' /></a></li>
            <li><a href="#pnlAmbito">
                <asp:Literal ID="Literal11" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionDeMarketing.Tab.Ambitos"]%>' /></a></li>
            <li ><a href="#pnlAccionesDeMarketing">
                <asp:Literal ID="Literal12" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["Bo.AccionDeMarketing.Tab.Comunicaciones"]%>' /></a></li>
        </ul>--%>
        <asp:Panel ID="pnlListasDeDistribucion" CssClass="editionContainerForGrid" runat="server"
            ClientIDMode="Static">
            <div class="clear">
            </div>
            <asp:GridView ID="GridListasDistribucion" runat="server" CellPadding="4" ForeColor="#333333"
                GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%" AllowPaging="False"
                PageSize="15" OnRowCommand="GridListasDistribucion_RowCommand" OnRowDataBound="GridListasDistribucion_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                        Text="Button" AccessibleHeaderText="editar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:TemplateField HeaderText="">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/eliminar.png"
                                CommandName="eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Id" HeaderText="Id" Visible="false">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Nombre" HeaderText='<%$ Code:  LocalizationProvider.Instance["MaestroBase.Nombre"] %>'
                        SortExpression="Nombre">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left"
                    CssClass="gridSortingHeader" />
                <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" CssClass="gridSortingHeader" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" CssClass="gridSortingHeader" />
            </asp:GridView>
        </asp:Panel>
        <asp:Panel ID="pnlResults" CssClass="editionContainerForGrid" runat="server" ClientIDMode="Static">
            <asp:GridView ID="GridResultados" runat="server" CellPadding="4" ForeColor="#333333"
                GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%" AllowPaging="False"
                OnRowDataBound="GridResultados_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="AccionDeMarketingId" Visible="false">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ContactoId" Visible="false">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ContactoEmail" HeaderText='<%$ Code: LocalizationProvider.Instance["Contacto.Email"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ContactoNombre" HeaderText='<%$ Code: LocalizationProvider.Instance["Contacto.Nombre"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ContactoApellido" HeaderText='<%$ Code: LocalizationProvider.Instance["Contacto.Apellido"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="EstadoEmail" HeaderText='<%$ Code:  LocalizationProvider.Instance["Contacto.EstadoEmail"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="AbrioEmail" HeaderText='<%$ Code:  LocalizationProvider.Instance["CampaniaInstanciaResultado.AbrioEmail"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FechaAperturaEmail" HeaderText='<%$ Code:  LocalizationProvider.Instance["CampaniaInstanciaResultado.FechaAperturaEmail"] %>'
                        DataFormatString="{0:dd-MM-yyyy}">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>                   
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </asp:Panel>
        <asp:Panel ID="pnlAmbito" CssClass="editionContainerForGrid" runat="server" ClientIDMode="Static">
            <p>
                <span class="title2">
                    <asp:Literal ID="Literal13" runat="server" Text='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.AmbitoTodos"]%>' />:
                </span>
                <asp:CheckBox ID="chkAmbitoTodos" runat="server" ClientIDMode="Static" />
            </p>
            <div class="clear">
            </div>
            <asp:GridView ID="GridAmbito" runat="server" CellPadding="4" ForeColor="#333333"
                GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%" AllowPaging="False"
                OnRowDataBound="GridAmbito_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                        Text="Button" AccessibleHeaderText="editar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:TemplateField HeaderText="">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/eliminar.png"
                                CommandName="eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Id" HeaderText="Id" Visible="false">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Nombre" HeaderText='<%$ Code:  LocalizationProvider.Instance["MaestroBase.Nombre"] %>'
                        SortExpression="Nombre">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </asp:Panel>
        <asp:Panel ID="pnlAccionesDeMarketing" CssClass="editionContainerForGrid" runat="server"
            ClientIDMode="Static">
            <div class="clear">
            </div>
            <asp:GridView ID="GridAccionesDeMarketing" runat="server" CellPadding="4" ForeColor="#333333"
                GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%" AllowPaging="False"
                PageSize="15" OnRowCommand="GridAccionesDeMarketing_RowCommand" OnRowDataBound="GridAccionesDeMarketing_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                        Text="Button" AccessibleHeaderText="editar">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:ButtonField>
                    <asp:TemplateField HeaderText="">
                        <HeaderStyle HorizontalAlign="Left" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/eliminar.png"
                                CommandName="eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Nombre" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Nombre"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Codigo" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Codigo"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FechaEventoDesde" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.FechaEventoDesde"] %>'
                        DataFormatString="{0:dd/MM/yyyy}">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FechaEventoHasta" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.FechaEventoHasta"] %>'
                        DataFormatString="{0:dd/MM/yyyy}">
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Discriminador" HeaderText='<%$ Code:  LocalizationProvider.Instance["AccionDeMarketing.Discriminador"] %>'>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left"
                    CssClass="gridSortingHeader" />
                <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" CssClass="gridSortingHeader" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" CssClass="gridSortingHeader" />
            </asp:GridView>
        </asp:Panel>
    </div>
    </asp:Panel>
    <br />
     <div class="commandBarDiv">
       <%-- <asp:LinkButton ID="lnkGuardar" runat="server" CssClass="guardar" OnClick="lnkGuardar_Click"></asp:LinkButton>
        <div class="clear">
        </div>--%>
    </div>
    <script type='text/javascript'>

        $(document).ready(function () {

            if (!window.AppCommonObj) {
                window.AppCommonObj = new AppCommon();
            }

            if (!window.CrmCommonObj) {
                window.CrmCommonObj = new CrmCommon();
            }

            $('#txtFechaEventoDesde').datepick({ dateFormat: 'dd/mm/yyyy' });
            $('#txtFechaEventoHasta').datepick({ dateFormat: 'dd/mm/yyyy' });

            if (!window.AccionDeMarketingEditObj) {
                window.AccionDeMarketingEditObj = new AccionDeMarketingEdit();
            }

            $("#tabs").tabs();
            

            $('input[title]').inputHints();

            document.DirtyCheck = new DirtyCheck();
            document.DirtyCheck.loadControlState();

            $(window).unload(function () {
                if (document.DirtyCheck.areControlsDirty()) { return confirm(JsLocalization_DirtyMessageConfirmContinue); } else { return true; }
            });
        });

    </script>
</asp:Content>
